package com.atguigu.gulimall.product.service;

import com.atguigu.gulimall.product.model.param.AttrParam;
import com.atguigu.gulimall.product.model.vo.AttrRelationVO;
import com.atguigu.gulimall.product.model.vo.AttrRespVO;
import com.atguigu.gulimall.product.model.vo.AttrVO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.AttrEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author glh
 * @email 2889535252@gmail.com
 * @date 2022-02-10 13:56:36
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveAttr(AttrVO attr);

    PageUtils queryBaseAttrPage(Map<String, Object> params, Long catelogId, String attrType);

    AttrRespVO queryAttrInfo(Long attrId);

    void updateAttr(AttrParam attr);

    List<AttrEntity> getRelationAttr(Long attrgroupId);

    void attrRelationDelete(AttrRelationVO[] attrRelationVO);

    PageUtils attrNoRelation(Long attrgroupId, Map<String, Object> params);

    /**
     * 找到索引字段
     * @param attrIds
     * @return
     */
    List<Long> selectSearchAttrs(List<Long> attrIds);
}

